
#include<iostream>
using namespace std;
class myclass
{
int longitude,latitude;
int a[3];
public:
myclass() {}
myclass(int lg,int lt)
{
longitude=lg;
latitude=lt;
}
myclass(int a1,int b,int c)
{
a[0]=a1;
a[1]=b;
a[2]=c;
}
void show(){
cout<<longitude<<" ";
cout<<latitude<<"\n";
}
int operator[](int i){return a[i];}
myclass operator=(myclass op2);
myclass operator+=(myclass op2);
myclass operator()(int i,int j);
friend ostream &operator<<(ostream &stream,myclass);
};
myclass myclass::operator=(myclass op2)
{
longitude = op2.longitude;
latitude = op2.latitude;
return *this;
}
myclass myclass::operator+=(myclass op2)
{
longitude++;
latitude++;
return *this;
}

myclass myclass::operator()(int i,int j)
{
longitude=i;
latitude=j;
return *this;
}
ostream &operator<<(ostream &stream,myclass m)
{
stream <<m.a;
return stream;
}
int main()
{
myclass ob1(10,20),ob2(30,40),ob3(1,2,3);
ob1.show();
ob2.show();
ob2+=ob1;
ob1.show();
ob2.show();
ob1(7,8);
ob1.show();
ob2=ob1;
ob2.show();
cout<<ob3[1];

return 0;
}